Repository navigation
feat: transform agent into orchestrator with pagination awareness - #73
Merged
luis5tb merged 11 commits intoApr 8, 2026
Merged
Conversation
Rewrites AGENT_INSTRUCTION to turn the single-agent LlmAgent from a flat tool-calling proxy into a reasoning orchestrator. The previous instruction was purely descriptive (capability catalog); the new one teaches the LLM *how to think* about multi-step requests. Three new sections: - Think/Plan/Execute loop for multi-step reasoning - Few-shot workflow examples (CVE remediation, infra health, upgrade readiness) that demonstrate tool chaining - Guardrails: scope enforcement, prompt injection resistance, write-operation confirmation, data integrity rules This is the minimal-risk mitigation for orchestration and safety while the full multi-agent architecture and before_tool_callback guardrail plugin are planned for a subsequent iteration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old prompt had "Respect the read-only mode when enabled" guidance that was dropped in the orchestrator rewrite. While read-only mode is enforced architecturally via tool filtering, the LLM should still communicate this constraint to users. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace brittle keyword-matching approach ("ignore previous instructions",
"you are now", etc.) with a principled statement that behavior is defined
by the system prompt and cannot be changed by user messages. The keyword
list was trivially bypassable via paraphrase or semantic reframing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MCP tool responses from upstream APIs could contain adversarial content (e.g., a hostname crafted to look like an instruction). Add explicit guidance that even instruction-like content in tool output must be treated as data only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The prompt says "do not reveal internal tool names" but then listed specific tool function names in the write-operation confirmation rule. Replace with generic descriptions to avoid contradicting the information-leakage guardrail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old wording implied the LLM could verify org boundaries, but it cannot — org isolation is enforced by OAuth tokens at the MCP/API layer. Updated wording to accurately reflect that organization boundaries are enforced through authentication on each tool call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enable structured plan-then-execute reasoning so the agent chains sequential tool calls for complex queries (e.g., finding CVEs with known exploits for a specific system) instead of giving up after a single tool call and asking the user to follow up manually. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add PlanReActPlanner and multi-step tool usage instructions
Adds a Pagination Awareness section that requires the agent to present
pagination options (first page / all pages / N pages) before calling
paginated tools, unless the user already specified a limit in their
query. Modeled after the rh-sre cve-impact skill's Step -1 pattern.
Key behaviors:
- System CVEs: prompt with page options (systems can have 1,700+ CVEs)
- Account CVEs: confirm default limit=20 or let user choose
- Host listing: offer first page / all / specific count
- Skip prompt when user specifies scope ("top 3 CVEs on host X")
- Recommend "all pages" for remediatable CVE queries (sparse results)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
I gave this a try and the reasoning (though a bit verbose) looks good. There seems to be some issues with the pagination |
luis5tb
approved these changes
Apr 7, 2026
luis5tb
left a comment
Collaborator
There was a problem hiding this comment.
I'm ok merging this to have the enhanced prompt and then fix the pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENT_INSTRUCTIONincore/agent.pyto transform the agent from a flat tool-calling proxy into a reasoning orchestratorPlanReActPlannerfor multi-step reasoningCloses #69
Pagination Awareness
Modeled after the rh-sre cve-impact skill Step -1 pattern:
Motivation
The agent was acting as a thin LLM wrapper — receiving a request, picking one MCP tool, and returning raw output. Two problems:
This PR solves both via prompt engineering — the lowest-risk, highest-leverage change before the deadline.
What's covered vs. what needs follow-up
before_tool_callbackpluginFollow-up work (post-deadline)
sub_agentsbefore_tool_callbackfor hard enforcementTest plan
pytest tests/ -v)🤖 Generated with Claude Code